export const getToken = () => localStorage.getItem("token");
export const setToken = (token: string) => localStorage.setItem("token", token);
export const removeToken = () => localStorage.removeItem("token");

export const getUserName = () => localStorage.getItem("user");

export const setUserName = (name: string) => localStorage.setItem("user", name);

export const removeUserName = () => localStorage.removeItem("user");

export const getUserLoginTime = () => localStorage.getItem("userLoginTime");

export const setUserLoginTime = (time: string) => localStorage.setItem("userLoginTime", time);

export const removeUserLoginTime = () => localStorage.removeItem("userLoginTime");

export const getUserRole = () => localStorage.getItem("role");

export const setUserRole = (role: string) => localStorage.setItem("role", role);

export const removeUserRole = () => localStorage.removeItem("role");

export const getUserFrom = () => localStorage.getItem("from");

export const setUserFrom = (from: string) => localStorage.setItem("from", from);

export const removeUserFrom = () => localStorage.removeItem("from");

export const clearItems = () => {
  localStorage.removeItem("token");
  localStorage.removeItem("user");
  localStorage.removeItem("userLoginTime");
  localStorage.removeItem("role");
  localStorage.removeItem("from");
};